#ifndef MODEL_DUPLICATE_NAME_ERROR_HPP
#define MODEL_DUPLICATE_NAME_ERROR_HPP

#include "Model/ModelConfig.hpp"
#include <stdexcept>

namespace Model
{

/// @ingroup Model
/// @brief It is thrown when a name is duplicated in a collection.
class MODEL_API DuplicateNameError: public std::domain_error
{
public:
	/// @brief It initializes the exception.
	/// @param duplicateName the duplicated name.
	/// @param message the error message.
	DuplicateNameError( const NameString& duplicateName, const std::string& message = std::string());

	/// @brief It gets the duplicate name.
	const NameString& duplicateName() const { return duplicateName_; }

private:
	NameString duplicateName_;
};

} // namespace Model

#endif // MODEL_DUPLICATE_NAME_ERROR_HPP
